<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container {
            padding-left: 220px;
            padding-right: 220px;
        }

        .center {
            height: 500px;
            background-color: #84a2d4;
            float: left;
            width: 100%;

        }

        .left {
            width: 200px;
            float: left;
            height: 200px;
            background-color: #5cb85c;
            margin-left: -100%;
            position: relative;
            left: -220px;
        }

        .right {
            float: left;
            height: 200px;
            width: 200px;
            background-color: #00b3ee;
            margin-left: -220px;
            position: relative;
            right: -240px;

        }
    </style>
</head>
<body>
<article class="container">
    <div class="center">
        <h2>圣杯布局</h2>
    </div>
    <div class="left"></div>
    <div class="right"></div>
</article>
</body>

<script>
    /*
    * center部分的最小宽度不能小于left部分的宽度，否则会left部分掉到下一行
如果其中一列内容高度拉长(如下图)，其他两列的背景并不会自动填充。(借助等高布局正padding+负margin可解决，下文会介绍)
    * */
</script>
</html>
